package Chapter3;

class Person4{
	String name;
	int age;
	//定义两个参数的构造方法
	public Person4(String con_name,int con_age) {
		name=con_name;
		age=con_age;
	}
	//定义一个参数的构造方法
	public Person4(String con_name) {
		name=con_name;
	}
	public void speak() {
		System.out.println("Hola,this is "+name+" ,我今年"+age+"岁了。");
	}
}

public class Example07 {
	public static void main(String[] args) {
		Person4 p1=new Person4("陈杰");
		Person4 p2=new Person4("李芳",8);
		p1.speak();
		p2.speak();
	}

}
